<?php
require 'user.php';
require 'function.php';
if((file_exists($path=_decode($_GET['path']))==false)) {
header('Content-Type: text/html; charset=UTF-8');
echo <<<HTML
Error：404
HTML;
exit;
}
header('Content-Type: text/html; charset=UTF-8');
echo <<<HTML
<html>
<head>
<title>SVN 编辑属性</title>
<style type="text/css">
.big_board{background-color:#009BCE;color:#FFF;}
.board_title{margin-bottom:1px;border:1px solid #09F;}
</style>
</head>
<body>
<div class="big_board"><div class="board_title">爱特文管－路径信息</div></div>
HTML;
echo '<a href="index.php?path='._encode(dirname(realpath($path))).'">'.dirname(realpath($path)).'</a>/'.basename($path);
if($_POST['go']!=null) {
echo <<<HTML
<div class="big_board"><div class="board_title">爱特文管－系统提示</div></div>
HTML;
file_put_contents($f="data/prop.".session_id().".txt",$_POST['m']);
$m=escapeshellarg(svnpath($f));
$name=escapeshellarg($_POST['name']);
$pth=escapeshellarg(svnpath($path));
$cmd="svn propset $name -F $m $pth $_SESSION[key]";
echo htmlcode(cmd($cmd));
}
echo <<<HTML
<div class="big_board"><div class="board_title">SVN 编辑属性</div></div>
HTML;
echo '<form action="'.$_SERVER['PHP_SELF'].'?path='.$_GET['path'].'" method="post">';
echo '属性名:<input name="name" value="'.htmlspecialchars("$_POST[name]$_GET[name]").'"/>';
echo '属性值:<br/><textarea name="m" rows="'.$_SESSION['editset']['size'][0].'" cols="'.$_SESSION['editset']['size'][1].'"/>'.htmlcode($_GET['edit'] ? cmd("svn propget ".escapeshellarg($_GET['name'])." ".escapeshellcmd(svnpath($path)).($_GET['r'] ? " -r ".escapeshellcmd($_GET['r']) : "")." --strict $_SESSION[key]","utf-8") : file_get_contents("data/prop.".session_id().".txt"),true).'</textarea><br/>';
echo '<input type="submit" name="go" value="提交"/><br/>（可能会连接超时。如果超时，<a href="status.php?path='.$_GET['path'].'&amp;onlyshow=1">点击这里查看提交结果</a>）';

echo '</form>';
echo <<<HTML
<div class="big_board"><div class="board_title">By：Admin@Lspecial.Com</div></div>
</body>
</html>
HTML;
?>